import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Home",
    component: Home,
    children: [
      {
        path: "/home",
        name: "home",
        component: () => import("../page/home.vue"),
      },
      {
        path: "/user",
        name: "user",
        component: () => import("../page/userList.vue"),
      },
      {
        path: "/activityList",
        name: "activityList",
        component: () => import("../page/activityList.vue"),
      },
      {
        path: "/commodityList",
        name: "commodityList",
        component: () => import("../page/commodityList.vue"),
      },
      {
        path: "/courseList",
        name: "courseList",
        component: () => import("../page/courseList.vue"),
      },
      {
        path: "/orderList",
        name: "orderList",
        component: () => import("../page/orderList.vue"),
      },
      {
        path:"/placeList",
        name:"placeList",
        component: () => import("../page/placeList.vue"),
      },
    ],
  },
  {
    path: "/login",
    name: "Login",
    component: () => import("../views/Login.vue"),
  },
  {
    path:"/register",
    name:"register",
    component: () => import("../views/register.vue"),
  },
  {
    path:"/userHome",
    name:"userHome",
    component: () => import("../views/userHome.vue"),
  },
];

const router = new VueRouter({
  routes,
});

export default router;
